package carltechnology.com.mahjonggame.utils.views;

import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import butterknife.ButterKnife;
import butterknife.InjectView;
import carltechnology.com.mahjonggame.R;

/**
 * Created by WZTCM on 2016/6/20.
 */
public class PerGameView extends RelativeLayout {
    @InjectView(R.id.round_textview_image)
    ImageView imageView;
    @InjectView(R.id.round_textview_text)
    TextView textView;

    private Context context;
    public ImageView getImageView() {
        return imageView;
    }

    public TextView getTextView() {
        return textView;
    }

    public PerGameView(Context context) {
        super(context);
        initView(context);
    }

    public PerGameView(Context context, AttributeSet attrs) {
        super(context, attrs);
        initView(context);
    }

    public PerGameView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initView(context);
    }

    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    public PerGameView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
        initView(context);
    }
    private void initView(Context context) {
        View view = View.inflate(context, R.layout.round_textview, this);
        ButterKnife.inject(this, view);
        this.context = context;
    }
}
